import request from "@/utils/request";

/**
 * 分页查询动态
 * @param param
 * @returns {AxiosPromise}
 */
export function page(param) {
    return request({
        url: '/dynamic/page',
        method: 'get',
        params: param
    })
}

/**
 * 动态详情
 * @param uuid
 * @returns {AxiosPromise}
 */
export function detail(uuid) {
    return request({
        url: '/dynamic/detail/' + uuid,
        method: 'get',
    })
}

/**
 * 审核通过
 * @param param
 * @returns {AxiosPromise}
 */
export function pass(param) {
    return request({
        url: '/dynamic/pass/' + param.uuid,
        method: 'put',
        data: param
    })
}

/**
 * 审核未通过
 * @param param
 * @returns {AxiosPromise}
 */
export function noPass(param) {
    return request({
        url: '/dynamic/no-pass/' + param.uuid,
        method: 'put',
        data: param
    })
}

/**
 * 开启评论
 * @param uuid
 * @returns {AxiosPromise}
 */
export function openComment(uuid) {
    return request({
        url: '/dynamic/open-comment/' + uuid,
        method: 'put',
    })
}

/**
 * 关闭评论
 * @param uuid
 * @returns {AxiosPromise}
 */
export function closeComment(uuid) {
    return request({
        url: '/dynamic/close-comment/' + uuid,
        method: 'put',
    })
}

/**
 * 删除动态
 * @param uuid
 * @returns {AxiosPromise}
 */
export function deleted(uuid) {
    return request({
        url: '/dynamic/delete/' + uuid,
        method: 'delete',
    })
}

/**
 * 导出动态
 * @param param
 * @returns {AxiosPromise}
 */
export function exportData(param) {
    return request({
        url: '/dynamic/export',
        method: 'post',
        params: param,
        responseType: 'blob'
    })
}

/**
 * 批量删除
 * @param param
 * @returns {AxiosPromise}
 */
export function batchDelete(param) {
    return request({
        url: '/dynamic/batch-delete',
        method: 'delete',
        data: param,
    })
}

/**
 * 分页查询某个圈子下的动态
 * @param param
 * @param circleUuid
 * @returns {AxiosPromise}
 */
export function pageByCircleUuid(param,circleUuid) {
    return request({
        url: '/dynamic/page-by-circle-uuid/' + circleUuid,
        method: 'get',
        params: param,
    })
}


